# gtk-server
# Builds from https://github.com/puppylinux-woof-CE/petbuilds
# File auto generated by ./mk_petbuild.sh. Edit as necessary.

. ../../func
. ../../build.conf

URL=http://www.gtk-server.org/stable
PKG=gtk-server
VER=2.4.4
COMP=tar.gz
DESC="gtk-server"
DEPS=
CAT=BuildingBlock
DESKTOP=gtk-server.desktop
BUILD=
CWD=$(pwd)
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
# comment these 2 below if you use a custom package() function
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not

ARCH=$(uname -m)
case $ARCH in # set in build.conf
 *64) 	LIBDIR=$LIBCONF64 
		FLAGS=$CF64;;
 arm*)	LIBDIR=$LIBCONFarm
		FLAGS="-O2" ;;
 i686) 	LIBDIR=$LIBCONF32 
		FLAGS=$CF32;;
	*) 	LIBDIR=$LIBCONF32 
		FLAGS="-O2 -march=$ARCH -mtune=$ARCH";;
esac

# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}

#--
cp ${PKG}-${VER}/src/* ${PKG}-${VER}/
EXTRA_CONFIG_OPTS='--with-gtk2'
#--

build_configure $PKG $VER $LIBDIR "$FLAGS"

cd ${PKG}-${VER}
sed -i "s|^prefix =.*|prefix = $CWD/${PKG}-install/usr|" Makefile
sed -i "s|^LIBDIR =.*|LIBDIR = $CWD/${PKG}-install/usr/lib|" Makefile
sed -i "s|^SYSCONFIG =.*|SYSCONFIG = $CWD/${PKG}-install/etc|" Makefile
sed -i '/man/d' Makefile
sed -i '/doc/d' Makefile
make install
cd -

package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT
